<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <title>dc-example</title>
    <script src="/libs/dc-sdk/dc.min.js"></script>
    <link href="/libs/dc-sdk/dc.min.css" type="text/css" rel="stylesheet" />
    <link href="../index.css" type="text/css" rel="stylesheet" />
  </head>

  <body>
    <div id="viewer-container" class="viewer-container"></div>
    <script>
      DC.config.baseUrl = '../libs/dc-sdk/resources/'
      let viewer = new DC.Viewer('viewer-container')
      let baseLayer = DC.ImageryLayerFactory.createAMapImageryLayer({
        style: 'img',
        crs: 'WGS84',
      })
      viewer.addBaseLayer(baseLayer)
      let layer = new DC.VectorLayer('layer')
      viewer.addLayer(layer)
      let redCylinder = new DC.Cylinder('120.1,32,10000', 20000, 5000, 5000)
      redCylinder.setStyle({
        material: DC.Color.RED.withAlpha(0.5),
      })
      let greenCylinder = new DC.Cylinder('120.3, 32.0,10000', 20000, 0, 5000)
      greenCylinder.setStyle({
        material: DC.Color.GREEN.withAlpha(0.5),
      })
      let blueCylinder = new DC.Cylinder('120.5, 32.0,10000', 20000, 5000, 0)
      blueCylinder.setStyle({
        material: DC.Color.BLUE.withAlpha(0.5),
      })
      let yellowCylinder = new DC.Cylinder('120.7,32.0,10000', 20000, 0, 5000)
      yellowCylinder.setStyle({
        slices: 4,
        material: DC.Color.YELLOW.withAlpha(0.5),
      })
      let orangeCylinder = new DC.Cylinder(
        '120.9,32.0,2500,90,90',
        5000,
        5000,
        0
      )
      orangeCylinder.setStyle({
        slices: 4,
        material: DC.Color.ORANGE.withAlpha(0.5),
      })
      layer
        .addOverlay(redCylinder)
        .addOverlay(greenCylinder)
        .addOverlay(blueCylinder)
        .addOverlay(yellowCylinder)
        .addOverlay(orangeCylinder)
      viewer.flyTo(layer)
    </script>
  </body>
</html>
